<style>
input { background:#FFFFC4; border:0px; border:#CACA00 1px dotted; }
.form_edit { height:80px; line-height:25px; }
#url { width:300px; color:#aa0000; }
#parent_id, #link_cat_id { width:50px; }
.button { word-spacing:3px; }
.button a { background:#939300; color:#ffffff; padding:1px; text-decoration:none; }
</style>

<script>
function title_change(obj) {
	item_obj.html($(obj).val());
}

function edit_submit() {
	$.post('./?m=link&a=ajax_edit_do', {
		link_item_id : $('.form_edit #link_item_id').val(),
		title : $('.form_edit #title').val(), 
		url : $('.form_edit #url').val(), 
		parent_id : $('.form_edit #parent_id').val(), 
		link_cat_id : $('.form_edit #link_cat_id').val() 
	}, function(data) {
		var text = data == '1' ? '保存成功！' : '保存失败！';
		item_info_obj.html(text);
	});
}
</script>

<div class="form_edit">
	<input type="hidden" name="link_item_id" value="<?php echo $res['link_item_id']?>" id="link_item_id" />
	<input type="text" name="title" value="<?php echo $res['title']?>" onChange="title_change(this);" id="title" />
	<br>
	地址 <input type="text" name="url" value="<?php echo $res['url']?>" id="url" />
	<br>
	分类 <input type="text" name="link_cat_id" value="<?php echo $res['link_cat_id']?>" id="link_cat_id" />
	&nbsp;
	父链 <input type="text" name="parent_id" value="<?php echo $res['parent_id']?>" id="parent_id" />
</div>

<div class="button">
	<a href="#" onclick="edit_submit();">保存修改</a>
	<a href="?m=link&a=delete&item_id=<?php echo $res['link_item_id']?>" onclick="return confirm('确定要删除吗?')">删除</a>
	&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="<?php echo $res['url']?>" target="_blank">访问</a>
	<a href="#" onclick="hide_item_info();">关闭</a>
</div>
